/**
 * Copyright (C), 2015-2019, XXX有限公司
 * FileName: GoldenConstant
 * Author:   zhouheng
 * Date:     2019/6/7 22:16
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.zhouh.golden.common.constants;

import lombok.NoArgsConstructor;

/**
 * 〈一句话功能简述〉<br> 
 * 〈〉
 *
 * @author zhouheng
 * @create 2019/6/7
 * @since 1.0.0
 */

@NoArgsConstructor
public class GoldenConstant {
    public static final String SESSION_KEY_SMS_CODE = "SESSION_KEY_SMS_CODE";

    // excel
    public static final String XLSX_SUFFIX = ".xlsx";
    public static final String XLSX_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";

    public enum  ResponseCodeEnum {
        SYS_SUCCESS("000000", "成功"),
        SYS_PARAM_NOT_RIGHT("001001", "请求数据校验失败"),
        QUERY_DATA_NOT_EXIST("001002", "查询数据不存在"),
        STATUS_NOT_RIGHT("001003", "数据状态校验不通过"),
        REQUEST_DATA_NOT_EXIST("001004", "请求提交的数据不存在"),
        USER_NOT_LOGIN("001006","用户未登录"),
        USER_OR_PASSWORD_ERROR("001007","用户不存在或帐号密码错误"),
        ACCESS_LIMITER("001008","访问被限制"),
        DATA_SAVE_ERROR("001009","数据保存失败"),
        SYSTEM_BUSY("001099", "系统繁忙,请稍后重试");

        private final String code;
        private final String msg;

        ResponseCodeEnum(String code, String msg){
            this.code=code;
            this.msg=msg;
        }

        public String getCode(){
            return code;
        }
        public String getMsg(){
            return msg;
        }

        public String getMsg(String detailDesc){
            return msg+" : "+detailDesc;
        }
    }

    // 图形验证码 session key
    public static final String SESSION_KEY_IMAGE_CODE = "SESSION_KEY_IMAGE_CODE";

    // 用户注册 URL
    public static final String GOLDEN_REGIST_URL = "/user/regist";

    // 返回报文头 json格式，编码 utf-8
    public static final String JSON_UTF8 = "application/json;charset=utf-8";

    /**
     * 验证图片验证码时，http请求中默认的携带图片验证码信息的参数的名称
     */
    public static final String DEFAULT_PARAMETER_NAME_CODE_IMAGE = "imageCode";
    /**
     * 验证短信验证码时，http请求中默认的携带短信验证码信息的参数的名称
     */
    public static final String DEFAULT_PARAMETER_NAME_CODE_SMS = "smsCode";

    // QQ openId 获取 URL
    public static final String GET_QQ_OPEN_ID_URL = "https://graph.qq.com/oauth2.0/me?access_token=%s";
    // QQ 用户信息获取 URL
    public static final String GET_QQ_USER_INFO_URL = "https://graph.qq.com/user/get_user_info?oauth_consumer_key=%s&openid=%s";
    // QQ 授权接口 URL
    public static final String QQ_AUTHORIZE_URL = "https://graph.qq.com/oauth2.0/authorize";
    // 获取 QQ AccessToken URL
    public static final String GET_QQ_ACCESSTOKEN_URL = "https://graph.qq.com/oauth2.0/token";

    // 社交账户 openId session key
    public static final String SESSION_KEY_SOCIAL_OPENID = "SESSION_KEY_SOCIAL_OPENID";

    // 权限不足 URL
    public static final String GOLDEN_ACCESS_DENY_URL = "/access/deny/403";

}